<?php

namespace app\admin\validate;

use think\Validate;

class Payment extends Validate
{
    protected $rule = [
        'payno' => 'require|max:50',
        'status' => 'in:10,20,30',
        'pay_amount' => 'require|float|gt:0',
        'purchaseid' => 'require|integer|gt:0',
        'owner' => 'require|integer|gt:0',
        'payment_date' => 'require|date',
        'payment_account' => 'require|max:100',
        'pay_type' => 'require|integer',
        'recipient_account' => 'require',
        'remark' => 'max:65535',
        'attachment' => 'max:255',
        'responsible' => 'integer|gt:0',
        'creator' => 'integer|gt:0',
        'create_time' => 'date',
        'update_time' => 'date',
        'updater' => 'integer|gt:0',
        'is_del' => 'integer|in:0,1',
    ];

    protected $scene = [
        'search' => ['name' => 'max:255'],
        'delete' => ['ids' => 'require|array|checkIds'],
        'show' => ['id' => 'require'],
        'save' => [
            'pay_amount',
            'purchaseid',
            'owner',
            'payment_account',
            'pay_type',
            'recipient_account',
            'responsible'
        ],
        'create' => [
            'pay_amount',
            'purchaseid',
            'owner',
            'payment_account',
            'pay_type',
            'recipient_account',
            'responsible'
        ],
        'examine' => ['id' => 'require','status'=>'require'],
        'proof' => ['proof' => 'require','id' => 'require']
    ];

}
